//
//  textView.m
//  DuiTang--
//
//  Created by Lina Zhang on 16/10/11.
//  Copyright © 2016年 jpw. All rights reserved.
//
#import "DWHomeItem.h"
#import <UIImageView+WebCache.h>
#import "textView.h"
@interface textView()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *categaryLabel;
@property (weak, nonatomic) IBOutlet UILabel *authorLabel;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
@end
@implementation textView
+(instancetype)textView{
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].firstObject;
}
-(void)setItem:(DWHomeItem *)item{
    _item = item;
    self.titleLabel.text = item.titleText;
    self.categaryLabel.text = item.content_category;
    if (item.nickname) {
        self.authorLabel.hidden = NO;
        if ([item.nickname isEqualToString:@""]) {
            self.authorLabel.hidden = YES;
        }else{
            self.authorLabel.hidden = NO;
            self.authorLabel.text = [NSString stringWithFormat:@"|  %@",item.nickname];
        }
    }else{
        self.authorLabel.hidden = YES;
    }
    self.countLabel.text = item.dynamic_info2;
}

@end
